import request from '@/utils/request'
// 发送短信验证码
export const sendMessageAuthCode = data => {
  return request({
    method: 'POST',
    url: '/sendMessageAuthCode',
    data
  })
}
// 获取就诊卡
export const cardList = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/cardlist',
    params: {
      id
    }
  })
}
export const getTasks = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/getTasks',
    params: {
      id
    }
  })
}
// 华西园区科室列表
export const selFirstDept = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/selFirstDept',
    params: {
      id
    }
  })
}
// 按更多条件选择医生列表
export const selDoctorListByMoreTerm = (id, deptCategoryCode) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/selDoctorListByMoreTerm',
    params: {
      id, deptCategoryCode
    }
  })
}

// 创建任务
export const appointmentTasks = data => {
  return request({
    method: 'POST',
    url: '/api/v1/appointmentTasks/insert/appointmentTasks',
    data
  })
}

// 任务列表
export const getTasksPages = data => {
  return request({
    method: 'POST',
    url: '/gpt_doctor/api/v1/gpt',
    data
  })
}
export const addValuate = data => {
  return request({
    method: 'POST',
    url: '/gpt_doctor/api/v1/add_valuate',
    data
  })
}
export const gptValueOne = params => {
  return request({
    method: 'GET',
    url: '/gpt_doctor/api/v1/gpt_value_one',
    params // 这里使用 params 而不是 data
  })
}

export const appointmentToPay = data => {
  return request({
    method: 'POST',
    url: '/api/v1/appointmentTasks/appointmentToPay',
    data
  })
}
// 删除任务
export const getOne = id => {
  return request({
    method: 'GET',
    url: '/gpt_doctor/api/v1/gpt_one',
    params: {
      id
    }
  })
}

export const updateOne = id => {
  return request({
    method: 'GET',
    url: '/gpt_doctor/api/v1/update_one',
    params: {
      id
    }
  })
}

// 获取验证码
export const getImageCode = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/getImageCode',
    params: {
      id
    }
  })
}

// 获取排班
export const selWeekScheduleTwo = data => {
  return request({
    method: 'POST',
    url: '/api/v1/appointmentTasks/selWeekScheduleTwo',
    data
  })
}

// 配置任务
export const configuration = data => {
  return request({
    method: 'POST',
    url: '/api/v1/appointmentTasks/configuration/appointmentTasks',
    data
  })
}
// 开启或取消任务
export const openOrCancel = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/openOrCancel',
    params: {
      id
    }
  })
}

// 复制任务
export const copy = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/copy',
    params: {
      id
    }
  })
}

export const checkToken = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/checkToken',
    params: {
      id
    }
  })
}

export const sureAppointment = (id) => {
  return request({
    method: 'GET',
    url: '/api/v1/appointmentTasks/sureAppointment',
    params: {
      id
    }
  })
}
